+= 2 increments by 2
def for_loop1(x):
result = 0
for i in x:
result += 2
return result
Function Call | Return Value | |||
---|---|---|---|---|
for_loop1('hello') | → | |||
for_loop1('world') | → | |||
for_loop1('apples') | → | |||
for_loop1('') | → | |||
for_loop1('a') | → | |||
for_loop1('oof') | → |
Experiment with this code on Gitpod.io